﻿using System;
using System.BusinessObjects.Data;
using Blazing.BusinessObjects.Locations;
using Blazing.BusinessObjects.Contacts;
using Iesi.Collections.Generic;
using System.Collections.Generic;

namespace Blazing.BusinessObjects.Products
{
    [Serializable]
    public class Order : DataObject<Order>
    {
        public virtual int ID
        {
            get { return GetValue<int>("ID"); }
            set
            {
                BeginEdit();
                SetValue("ID", value);
            }
        }

        public virtual Contact Orderer { get; set; }

        private IList<Product> _Items = new List<Product>();
        public virtual IList<Product> Items
        {
            get
            {
                return _Items;
            }
            set
            {
                _Items = value;
            }
        }

        public virtual bool IsPaid
        {
            get { return GetValue<bool>("IsPaid"); }
            set
            {
                BeginEdit();
                SetValue("IsPaid", value);
            }
        }

        public virtual string Reference
        {
            get { return GetValue<string>("Reference"); }
            set
            {
                BeginEdit();
                SetValue("Reference", value);
            }
        }

        public virtual string Receipt
        {
            get { return GetValue<string>("Receipt"); }
            set
            {
                BeginEdit();
                SetValue("Receipt", value);
            }
        }

        public virtual decimal Total
        {
            get { return GetValue<decimal>("Total"); }
            set
            {
                BeginEdit();
                SetValue("Total", value);
            }
        }

        public virtual DateTime RowStamp
        {
            get
            {
                return GetValue<DateTime>("RowStamp");
            }
            set
            {
                SetValue("RowStamp", value);
            }
        }
    }
}
